#ifndef _LIGHT_SUPPORT
#define _LIGHT_SUPPORT

float CalculateAttenuation(float3 attenuationFactors, float distanceToLight, float lightRange,
	float numerator = 1.0)
{
	float const_att = numerator / attenuationFactors.x;
	float quad_att = numerator / (attenuationFactors.z * distanceToLight*distanceToLight);
	float lin_att = numerator / (attenuationFactors.y * distanceToLight);
	return numerator / (const_att + lin_att * distanceToLight + quad_att * distanceToLight * distanceToLight);
}

float3 CalculateWorldSpacePosition(float2 scrPos, float depth, float4x4 inverseProj)
{
	float4 outval = float4(scrPos, depth, 1.f);
	outval = mul(outval, inverseProj);
	return outval;// / outval.w;

}

#endif